Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support post tags, auto generate TOC by tag #20

Open
wants to merge 17 commits into
base: master
Choose a base branch
from

Conversation

zeronetscript
Copy link

@zeronetscript zeronetscript commented Apr 25, 2016

these commits implements blog tag function. with this:
1.every post can have multi tags , which appears in details part ,
2.every tag (or untagged) appears as a link , which links to a TOC page of this tag(or show all untagged).
3.an overview TOC page, show all tag: n post(s), helps user navigate to that tag TOC (same as 2)

these changes consider upgrade from old data condition, user can overwrite index/js/css/dbschema then get all these functions

unknown and others added 17 commits April 21, 2016 12:02
when selecting posts, select count(*) from post as first row
so we can do better page display
previously only show prev/next, hard to jump. this improve it by:
support jump to first/last page
show current page and neighbour page links (instead of prev/next)
if not all next pages can showup, ... added to last link to notice user
add an entry in routeUrl to dispatch ?Toc= type url, then pageToc
query all blogs and generate a simple index for all, these index
grouped by same month (empty month skipped) order by date. page query
not implemented currently
blog can have a space splited tag list,these value-post_id map stored
in tag table. I think best way to implement this should be insert
trigger and CTE(requires sqlite 3.8.3), but zeronet didn't assume this,
so this implements by maintain tag table in frontend (coffeescript)
in post page, add a "taglist" under detail div, every tag is showed
as a link to query page , untagged post also has a link to query all
untagged posts(query implemented in next commit).this field can be
edit just like title and body
support three type TOC: index.html has link to "?Toc=tagAll",
which generated a overview tag index page as:

tag1: n post(s) ---> links to ?Toc=tag:tag1,shows all posts has tag1
tag2: m post(s)
...
untagged: x post(s) ---> links to Toc=tagNone, shows all posts without tags.

same post may belongs to many tag,leads too many duplicate, so tagAll
didn't show every posts. user can jump to extactly tag list from the
"tag list" part of every post (in previous commit)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant