-
Notifications
You must be signed in to change notification settings - Fork 62
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
zeronetscript
wants to merge
17
commits into
HelloZeroNet:master
Choose a base branch
from
zeronetscript:toc_by_tag
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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