mirror of
https://github.com/danpros/htmly.git
synced 2026-04-22 21:46:22 +05:30
Sitemap problems
Fix sitemap problems.
This commit is contained in:
parent
512fb61e73
commit
521f44df0a
1 changed files with 17 additions and 21 deletions
|
|
@ -872,7 +872,7 @@ function generate_rss($posts){
|
|||
echo $feed;
|
||||
}
|
||||
|
||||
// Return post, tag, archive url.
|
||||
// Return post, archive url.
|
||||
function get_path(){
|
||||
|
||||
$posts = get_post_sorted();
|
||||
|
|
@ -911,22 +911,6 @@ function get_path(){
|
|||
|
||||
// The post URL
|
||||
$post->url = site_url().date('Y/m', $post->date).'/'.str_replace('.md','',$arr[2]);
|
||||
|
||||
$tag = array();
|
||||
$url = array();
|
||||
|
||||
$t = explode(',', $arr[1]);
|
||||
foreach($t as $tt) {
|
||||
$tag[] = array($tt, site_url(). 'tag/' . $tt);
|
||||
}
|
||||
|
||||
foreach($tag as $a) {
|
||||
$url[] = $a[1];
|
||||
}
|
||||
|
||||
$post->tag = implode(', ', $url);
|
||||
|
||||
$post->tagb = implode(' » ', $url);
|
||||
|
||||
$tmp[] = $post;
|
||||
}
|
||||
|
|
@ -1011,11 +995,23 @@ function generate_sitemap($str){
|
|||
}
|
||||
elseif ($str == 'tag') {
|
||||
|
||||
$posts = get_path();
|
||||
$tag = array();
|
||||
$posts = get_post_unsorted();
|
||||
$tags = array();
|
||||
|
||||
foreach($posts as $p) {
|
||||
$tag[] = $p->tag;
|
||||
foreach($posts as $index => $v){
|
||||
|
||||
$arr = explode('_', $v);
|
||||
|
||||
$data = $arr[1];
|
||||
$mtag = explode(',', $data);
|
||||
foreach($mtag as $etag) {
|
||||
$tags[] = $etag;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
foreach($tags as $t) {
|
||||
$tag[] = site_url() . 'tag/' . $t;
|
||||
}
|
||||
|
||||
$tag = array_unique($tag, SORT_REGULAR);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue