Comments (5)
Cool! I love how malleable Emacs is!
If anyone is interested in this feature, feel free to re-open the issue!
from org-static-blog.
I am not sure I understand your questions completely. Please correct me if I'm misinterpreting something.
org-static-blog takes a bunch of org files in a posts
directory, and renders them as HTML in the main directory. In addition, it assembles an index.html
, an archive.html
, an RSS feed, a tags.html
, and one HTML page per tag.
Each file in posts
has a date, and optionally a number of tags. For example, one of my recent blog posts started with
#+title: How to Write a Dissertation
#+date: <2020-05-27 18:11>
#+filetags: computers emacs workflow
(I realize that I should put an example like this in the README. I'll do that right away.)
Does this answer your questions?
from org-static-blog.
Sorry if I wasn't clear, I meant that I don't like to have all the html pages in the main directory, I would prefer to the posts and the tags pages in dedicated folders.
It's a matter of personal tastes, but I would prefer that my urls would be something like this:
- http://www.myblog.com/post/my-post/ for posts
- http://www.myblog.com/tag/my-tag/ for tags
- http://www.myblog.com/rss/ for the feed
- http://www.myblog.com/archive/ for the archive
- http://www.myblog.com/ for the main page (the actual
index.html
)
In this way, evey generated html page need to be called index.html
and be placed inside a specific folder.
I was able to get a similar behaviour using only org
, I can try to get something similar with org-static-blog
.
What do you think?
from org-static-blog.
I think this is possible. There are customizable variables for pretty much every file name and directory. You might need to have "file names" such as "archive/archive.html" and create the enclosing "archive" by hand, but apart from that it should all work.
from org-static-blog.
I managed to get my goal, I simply added to my publish script the following lines:
(setq org-static-blog-tags-file "tag/index.html"
org-static-blog-archive-file "archive/index.html"
org-static-blog-rss-file "rss/index.rss")
(advice-add 'org-static-blog-generate-post-path
:around #'(lambda (orig-fun &rest args)
(let* ((filename (car args))
(new-filename (concat "post/"
(file-name-sans-extension filename)
"/index.html")))
(apply orig-fun (cons new-filename (cdr args))))))
(defun org-static-blog-assemble-tags ()
(org-static-blog-assemble-tags-archive)
(dolist (tag (org-static-blog-get-tag-tree))
(org-static-blog-assemble-multipost-page
(concat org-static-blog-publish-directory "tag/" (downcase (car tag)) "/index.html")
(cdr tag)
(concat "<h1 class=\"title\">" (org-static-blog-gettext 'posts-tagged) " \"" (car tag) "\":</h1>"))))
(defun org-static-blog-post-taglist (post-filename)
(let ((taglist-content ""))
(when (and (org-static-blog-get-tags post-filename) org-static-blog-enable-tags)
(setq taglist-content (concat "<a href=\""
(org-static-blog-get-absolute-url org-static-blog-tags-file)
"\">" (org-static-blog-gettext 'tags) "</a>: "))
(dolist (tag (org-static-blog-get-tags post-filename))
(setq taglist-content (concat taglist-content "<a href=\""
(org-static-blog-get-absolute-url (concat "tag/" (downcase tag) "/"))
"\">" tag "</a> "))))
taglist-content))
(advice-add 'org-static-blog-get-post-url
:around #'(lambda (orig-fun &rest args)
(file-name-directory (apply orig-fun args))))
I set three variables, advice
d and overwrote some functions.
This approach seems to work, all the internal links work. Maybe is not so elegant and I don't think it can be easily integrated.
I noticed that some links are extended e.g. /archive/index.html
instead of simply /archive/
but at least for posts and tags I solved this problem.
Solving this would require the overwriting of other functions (pretty long) and since it's not so important I think I'll leave like this.
You can close the issue, my approach cannot be easily integrated in the org-static-blog
and I don't understand if someone might be interested into this.
Otherwise, if someone is interested, I can consider to try to integrate it as optional configurable variable, since I don't think it's would be great to break the links of the current blogs.
from org-static-blog.
Related Issues (20)
- Cannot output files to blog directory HOT 5
- Have `index.html` and other `html` files in different locations HOT 1
- Unknown "nil" back-end: Aborting export HOT 7
- Annoying warnings HOT 1
- Is this still maintained? HOT 3
- Last package (20221018.933) is broken. Just a typo. HOT 2
- Backend unset or broken: `org-export-barf-if-invalid-backend: Unknown "nil" back-end: Aborting export` HOT 4
- Is there a way to run multiple blogs with this package? HOT 1
- Icorrect table rendering HOT 6
- Show only post titles in multipost pages (no preview, no contents) HOT 4
- Is it possible to support navigation in tags.html HOT 1
- Why everything get's re rendered? HOT 6
- Add a publish-to (eg local/prod) function? HOT 2
- Perhaps use `org-collect-keywords` to extract date? HOT 5
- Drafts are published to directory relative to posts directory instead of drafts directory HOT 6
- Warning : 'the function ‘list-length’ is not known tobe defined.' HOT 1
- customize index page HOT 3
- Publish not working all the time HOT 1
- Generated blog posts goes to "example.com/$file-name" HOT 1
- Switch from ox-publish to org-static-blog HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from org-static-blog.