Comments (4)
I have met the similar situation, my workaround is to cover the configuration outside the pulled repository.
(defun org-static-blog-get-preview (post-filename)
"Get title, date, tags from POST-FILENAME and get the first paragraph from the rendered HTML.
If the HTML body contains multiple paragraphs, include only the first paragraph,
and display an ellipsis.
Preamble and Postamble are excluded, too."
(with-temp-buffer
(insert-file-contents (org-static-blog-matching-publish-filename post-filename))
(let ((post-title (org-static-blog-get-title post-filename))
(post-date (org-static-blog-get-date post-filename))
(preview-region (org-static-blog--preview-region)))
;; Put the substrings together.
(let ((title-link
(format "<h2 class=\"post-title\"><a href=\"%s\">%s</a></h2>"
(org-static-blog-get-post-url post-filename) post-title))
(date-link
(format-time-string (concat "<div class=\"post-date\">"
(org-static-blog-gettext 'date-format)
"</div>")
post-date)))
(concat
title-link
preview-region
date-link
)))))
By doing so, only title, preview and date are displayed.
from org-static-blog.
Hi @protesilaos,
are you sure about the archive? The index should include full posts or previews, but the archive should only include headlines.
from org-static-blog.
from org-static-blog.
I see. If you'd like to contribute a mechanism for a headline-only index, I'd be happy to review it.
from org-static-blog.
Related Issues (20)
- 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
- 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
- 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
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.