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

how to setup my own css ? #89

Open
joonhwan opened this issue Mar 30, 2014 · 7 comments
Open

how to setup my own css ? #89

joonhwan opened this issue Mar 30, 2014 · 7 comments

Comments

@joonhwan
Copy link

Nice idea utilizing org as static generator with git.

I finally figured out how to update my own github.io pages, but from my point of view, the mod css looks too much for me. I just want to simplest css site. How to configure?

My own org-page configuration follows

(setq 
 op/site-main-title "Joonhwan' IO"
 op/site-sub-title "Random thoughts on many things"
 op/repository-directory "/Volumes/MyHdd/prj/oss/mine/joonhwan.github.io"
 op/site-domain "http://joonhwan.github.io/"
;;; for commenting, you can choose either disqus or duoshuo
 op/personal-disqus-shortname "joonhwan"
 op/personal-github-link "https://github.com/joonhwan"
 ;; ;;; the configuration below are optional
 ;; op/personal-google-analytics-id "your_google_analytics_id"
 ;; op/template-directory ---> ????
 ) 

it seems that op/template-directory var is key to do that but I've not catch up yet.
Any help would be appreciated.

Thanks.

@sillykelvin
Copy link
Collaborator

Hi,

For your requirement, It's better to define a new theme. But sorry, currently org-page can only support themes defined in the folder "themes" under its load directory. But, I have updated code to support customized theme directory. You may wait some time for melpa to update org-page to newest version and then you can upgrate org-page to do that, or you can clone the master branch to enable this feature immediately.

Assume you have a theme called "simple", stored at "/themes", you should set the two variables:

(setq op/theme-root-directory "/themes")
(setq op/theme 'simple)

And your own theme directory should have the following structure:

- /themes         <= theme root directory
  |- simple       <= theme name
     |- resources
        |- css    <= folder to store styles, however, the name is not required to be css, it depends on the path you defined in header.mustache, same as below two
        |- img
        |- js
     |- templates <= templates folder, the following templates are all required, and names should not be changed
        |- about.mustache
        |- category-index.mustache
        |- container.mustache
        |- footer.mustache
        |- header.mustache
        |- index.mustache
        |- nav.mustache
        |- post.mustache
        |- tag.mustache
        |- tag-index.mustache
   |- another_theme

Oh, so many files, uh? However, as you described, you just want to do some customization to css, so, you could just copy the templates folder of theme mdo to your own theme, and customize the resources folder (as you want to customize css, I suppose you may also want to customize javascript files and images, and I believe you may also want to customize those templates in the future :-p).

Hope that helps,
Kelvin

@joonhwan
Copy link
Author

joonhwan commented Apr 1, 2014

Thanks for the updates.
I'll try with the new version after coming back to my business travel.

@shackra
Copy link

shackra commented Oct 16, 2014

I tested this and works find. I would just change the themes name if you copied the =themes= directory under org-page directory, because org-page seems to not updated the generated html files if the name of the themes is the same.

@kat-co
Copy link

kat-co commented Dec 21, 2014

Also tested with the latest version, and this looks fine. I suggest closing this issue.

@sillykelvin
Copy link
Collaborator

After you changed something in the templates, you need to clear the template cache to make the changes take effect:

(setq op/item-cache nil)

Sorry that I didn't mention this above.

@shackra
Copy link

shackra commented Mar 5, 2015

in mdo template, there is a file called template.html, what's it for?

@sillykelvin
Copy link
Collaborator

@shackra Oh, it's an obsolete template, which is used by early version org-page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants