Giter Site home page Giter Site logo

ratanshreshtha / deepthought Goto Github PK

View Code? Open in Web Editor NEW
171.0 11.0 91.0 3.89 MB

A simple blog theme focused on writing powered by Bulma and Zola.

Home Page: https://deepthought-theme.netlify.app/

License: MIT License

JavaScript 5.13% HTML 18.49% Sass 76.38%
zola bulma theme netlify blog-theme hacktoberfest hactoberfest2022

deepthought's Introduction

logo

DeepThought

A simple blog theme focused on writing powered by Bulma and Zola.

contributors last update forks stars open issues license


📔 Table of Contents

🌟 About the Project

📷 Screenshots

screenshot

👾 Tech Stack

  • Zola - Your one-stop static site engine
  • Bulma - The modern CSS framework that just works.

🎯 Features

  • Dark Mode
  • Pagination
  • Search
  • Charts
  • Maps
  • Diagrams
  • Galleria
  • Analytics
  • Comments
  • Categories
  • Social Links
  • Multilingual Navbar
  • Katex

🧰 Getting Started

‼️ Prerequisites

You need static site generator (SSG) Zola installed in your machine to use this theme follow their guide on getting started.

⚙️ Installation

Follow zola's guide on installing a theme. Make sure to add theme = "DeepThought" to your config.toml

Check zola version (only 0.9.0+) Just to double-check to make sure you have the right version. It is not supported to use this theme with a version under 0.14.1.

🏃 Run Locally

Go into your sites directory and type zola serve. You should see your new site at localhost:1111.

NOTE: you must provide the theme options variables in config.toml to serve a functioning site

🚩 Deployment

Zola already has great documentation for deploying to Netlify or Github Pages. I won't bore you with a regurgitated explanation.

👀 Usage

Following options are available with the DeepThought theme

# Enable external libraries
[extra]
katex.enabled = true
katex.auto_render = true

chart.enabled = true
mermaid.enabled = true
galleria.enabled = true

navbar_items = [
 { code = "en", nav_items = [
  { url = "$BASE_URL/", name = "Home" },
  { url = "$BASE_URL/posts", name = "Posts" },
  { url = "$BASE_URL/docs", name = "Docs" },
  { url = "$BASE_URL/tags", name = "Tags" },
  { url = "$BASE_URL/categories", name = "Categories" },
 ]},
]

# Add links to favicon, you can use https://realfavicongenerator.net/ to generate favicon for your site
[extra.favicon]
favicon_16x16 = "/icons/favicon-16x16.png"
favicon_32x32 = "/icons/favicon-32x32.png"
apple_touch_icon = "/icons/apple-touch-icon.png"
safari_pinned_tab = "/icons/safari-pinned-tab.svg"
webmanifest = "/icons/site.webmanifest"

# Author details
[extra.author]
name = "DeepThought"
avatar = "/images/avatar.png"

# Social links
[extra.social]
email = "<email_id>"
facebook = "<facebook_username>"
github = "<github_username>"
gitlab = "<gitlab_username>"
keybase = "<keybase_username>"
linkedin = "<linkedin_username>"
stackoverflow = "<stackoverflow_userid>"
twitter = "<twitter_username>"
instagram = "<instagram_username>"
behance = "<behance_username>"
google_scholar = "<googlescholar_userid>"
orcid = "<orcid_userid>"
mastodon_username = "<mastadon_username>"
mastodon_server = "<mastodon_server>" (if not set, defaults to mastodon.social)


# To add google analytics
[extra.analytics]
google = "<your_gtag>"

# To add disqus comments
[extra.commenting]
disqus = "<your_disqus_shortname>"

# To enable mapbox maps
[extra.mapbox]
enabled = true
access_token = "<your_access_token>"

Multilingual Navbar

If you want to have a multilingual navbar on your blog, you must add your new code language in the languages array in the config.toml file.

NOTE: Don't add you default language to this array

languages = [
    {code = "fr"},
    {code = "es"},
]

And then create and array of nav item for each language:

NOTE: Include your default language in this array

navbar_items = [
 { code = "en", nav_items = [
  { url = "$BASE_URL/", name = "Home" },
  { url = "$BASE_URL/posts", name = "Posts" },
  { url = "$BASE_URL/docs", name = "Docs" },
  { url = "$BASE_URL/tags", name = "Tags" },
  { url = "$BASE_URL/categories", name = "Categories" },
 ]},
 { code = "fr", nav_items = [
  { url = "$BASE_URL/", name = "Connexion" },
 ]},
 { code = "es", nav_items = [
  { url = "$BASE_URL/", name = "Publicationes" },
  { url = "$BASE_URL/", name = "Registrar" },
 ]}
]

en:

DeepThought

fr:

DeepThought

es:

DeepThought

KaTeX math formula support

This theme contains math formula support using KaTeX, which can be enabled by setting katex.enabled = true in the extra section of config.toml.

After enabling this extension, the katex short code can be used in documents:

  • {{ katex(body="\KaTeX") }} to typeset a math formula inlined into a text, similar to $...$ in LaTeX
  • {% katex(block=true) %}\KaTeX{% end %} to typeset a block of math formulas, similar to $$...$$ in LaTeX

Automatic rendering without short codes

Optionally, \\( \KaTeX \\) / $ \KaTeX $ inline and \\[ \KaTeX \\] / $$ \KaTeX $$ block-style automatic rendering is also supported, if enabled in the config by setting katex.auto_render = true.

Elasticlunr search in other language

Zola use Elasticlunr.js to add full-text search feature. To use languages other than en (English), you need to add some javascript files. See the Zola's issue #1349. By placing the templates/base.htmlon your project and using the other_lang_search_js block, you can load the required additional javascript files in the right timing.

e.g. templates/base.html

{% extends "DeepThought/templates/base.html" %} {% block other_lang_search_js %}
<script src="{{ get_url(path='js/lunr.stemmer.support.js') }}"></script>
<script src="{{ get_url(path='js/tinyseg.js') }}"></script>
<script src="{{ get_url(path='js/lunr.' ~ lang ~ '.js') }}"></script>
<script src="{{ get_url(path='js/search.js') }}"></script>
{% endblock %}

More detailed explanations are aound in elasticlunr's documents.

👋 Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  • Fork the Project
  • Create your Feature Branch (git checkout -b feature/AmazingFeature)
  • Commit your Changes (git commit -m 'Add some AmazingFeature')
  • Push to the Branch (git push origin feature/AmazingFeature)
  • Open a Pull Request

⚠️ License

Distributed under the MIT License. See LICENSE for more information.

🤝 Contact

Ratan Kulshreshtha - @RatanShreshtha - ratan.shreshtha[at]gmail.com

Project Link: https://github.com/RatanShreshtha/DeepThought

💎 Acknowledgements

Use this section to mention useful resources and libraries that you have used in your projects.

deepthought's People

Contributors

arichtman avatar bobankh avatar chrischinchilla avatar d2weber avatar dlecan avatar eopb avatar guileas avatar hadilq avatar hatappo avatar ian-fox avatar joesan avatar kenohassler avatar madhank93 avatar matejp0 avatar ratanshreshtha avatar rkinmobi avatar skyplabs avatar snystrom avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

deepthought's Issues

More than 1 Galleria errors out

Steps to Reproduce:

  • Clone this repo
  • in content/docs/extended-shortcodes/index.md copy paste the galleria shortcode so that there are more than 1 instances of the galleria gallery

Expected Results:

  • Properly rendered galleria galleries

Actual Results:
Screen Shot 2021-04-07 at 1 46 43 AM

Returns: Fatal error: Could not extract a stage height from the CSS. Traced height: 0px.

Attempts to fix:

Copy pasted the issue into Google this seems to occur with Galleria, but I none of the solutions worked for me. Tried setting height of the galleria-stage class, as well as the majority of the solutions proposed here: https://stackoverflow.com/questions/6610522/galleria-fatal-error-could-not-extract-a-stage-height-from-the-css-traced-heig.

Lang variable

Hi,

I'm trying to learn Zola and i'm inspired by this great theme,
I'm sorry to post this as a github issue but i can't find where is the lang variable defined, could anyone help me ?

Thanks for helping and for sharing this great theme.

Installation guide is incomplete

Following the instructions does not yield a working site.

mkdir zolatest
cd zolatest
zola init
# Complete init
cd themes
git clone [email protected]:RatanShreshtha/DeepThought.git
cd ..
vim config.toml
# Add theme = "DeepThought" near the top
zola serve

yields

Building site...
-> Creating 0 pages (0 orphan), 0 sections, and processing 0 images
Error: Failed to render section '/Users/$user/repos/zolatest/content/_index.md'
Reason: Failed to render 'index.html' (error happened in 'base.html').
Reason: Variable `config.extra.favicon.webmanifest` not found in context while rendering 'index.html'

Allow posts without dates

Reason: Filter call 'date' failed
Reason: Filter `date` received an incorrect type for arg `value`: got `Null` but expected i64|u64|String

Unable to use, further help needed.. :/

When I try to
zola serve

I get output as

Building site...
-> Creating 2 pages (0 orphan), 1 sections, and processing 0 images
Error: Failed to render '404.html'
Reason: Macro namespace macros was not found in template 404.html. Have you maybe forgotten to import it, or misspelled it?

Can you kindly help me out @RatanShreshtha ? :)

Paginators Gone Wild

Paginators Gone Wild, also clicking on page 1 from another page causes a redirect:

2022-05-16_22-53-16

Was thinking Something like this might be better:

2022-05-16_22-57-05

enable back page author (optional)

Hi!

First of all, thanks a lot for this great template @RatanShreshtha !

I am using your template and I am really happy with it!

I would like to contribute to your repo a modification I have done which:

  • enables back the support to add author to the RSS or Atom feed generator (which is supported on zola)
  • enables hyperlink on each author listed to its own presentation page
  • keeps current default behavior of using the config extra author name if no author list in page defined

Will provide the PR soon.

I hope you like it so we make it default for everyone too!

Best,

Feature Proposal: optional JavaScript libraries

I would like to make a pull request to make JavaScript libraries included a set of configuration options.

Before I make the changes and submit a PR I would like to get your feedback on whether this is something that you will likely accept and which of these two implementation options I should choose.

Within the site.js file there is some instantiation code for each library, such as galleria. If galleria is not included this needs to be handled.

We could:

  1. Make the instantiation code checking check for the presence of the library
  2. Or move the instantiation JavaScript into inline blocks in the base.html that can be conditionally included

I would choose option 2.

option 1:

// site.js
if (Galleria) {
  $(".galleria").each(function (index) {
    $(this).attr("id", `galleria-${index}`);

    var { images } = JSON.parse($(this).text());

    for (let image of images) {
      $(this).append(
        `<a href="${image.src}"><img src="${image.src}" data-title="${image.title}" data-description="${image.description}"></a>`
      );
    }

    Galleria.run(`.galleria`);
  });
}

option 2:

// base.html
<script>
{% if config.extra.javascript.galleria %}
  $(".galleria").each(function (index) {
    $(this).attr("id", `galleria-${index}`);

    var { images } = JSON.parse($(this).text());

    for (let image of images) {
      $(this).append(
        `<a href="${image.src}"><img src="${image.src}" data-title="${image.title}" data-description="${image.description}"></a>`
      );
    }

    Galleria.run(`.galleria`);
  });
{% endif %}
// more conditional javascript initializers here... 
</script>

Dark theme inverts YouTube and Vimeo player colors.

Steps to reproduce:

Expected results:

  • The embedded videos shouldn't be affected by the dark theme. They shouldn't have inverted colours.

Tested in:

  • Firefox Nightly 88 and Firefox Stable 86 (I could reproduce it)
  • Ungoogled Chromium 88 (I could reproduce it)

firefox_lgnQebFATc

A lot of things don't work on me (new on Zola)

Hello! Like I'm saying, I'm new to Zola and I really liked this theme and wanted to make my blog with it. Thank you for your amazing work!!!

I'm trying to get started, I have read the zola overview till the point to get started with my new project and then the installing theme section to install the theme just like you said. I also added a variable to the config.toml file to set the theme to DeepThought. Now I'm going to tell you exactly the steps I followed and the results I had so you can help me.

PROBLEM ONE
After installing the theme, I added the following variable in my config.toml file: theme = "DeepThought" just like you are saying in the README.md. After that I'm getting the following error message:

Error: Failed to render section '/home/rempas/Projects/Programming/Web/myblog/content/_index.md'
Reason: Failed to render 'index.html' (error happened in a parent template)
Reason: Variable `config.extra.navbar_items` not found in context while rendering 'index.html'

To fix that, I tried to copy the config.toml which is inside the theme to my project root directory. Additionally I added the variable to change the theme and now it works. The thing is. Is this suppose to be the case? Should I get the theme config? I'm asking because you don't said that in the README.md neither it is mentioned in the zola docs

PROBLEM TWO
The content is not showing up. While the templates and static directories didn't had to get copied to my root project directory to make them work, the content does not show up. I suppose this how Zola treats that posts. So is it safe to delete the content directory from the root directory of the DeepThought theme and just add posts in mine?

PROBLEM THREE
The search doesn't work. Do you have any idea why this is happening? I suppose it's probably a js thing but I have no idea...

Error: Expected newline.

Hey! my build failed because of the following error:

$ zola --version
zola 0.17.1
$ zola build
Building site...
Checking all internal links with anchors.
> Successfully checked 0 internal link(s) with anchors.
-> Creating 15 pages (0 orphan) and 1 sections
Error: Failed to build the site
Error: Error: Expected newline.
  ╷
4 │ @import url('[https://fonts.googleapis.com/css2?family=Jost:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap'](https://fonts.googleapis.com/css2?family=Jost:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap%27));
  │                                                                                                                                                                                                ^
  ╵
.//builds/hadilq/hadilq.gitlab.io/themes/DeepThought/sass/deep-thought.sass:4:192

where you can find it in https://gitlab.com/hadilq/hadilq.gitlab.io/-/jobs/3877170796

I switched back to zola 1.16.1 and avoid this problem for now. Also I tried to fix it but I have no experience with SASS format, but let me know if the fix is easy, so I'll test and create the PR.

Feature Request : Automatically switch to light or dark theme

Is it possible to implement switching to light or dark theme based on the system theme when something like
colorscheme = auto is set in config.toml
and, always use dark mode when colorscheme = dark is set
and, always use light mode when colorscheme = light is set
?

navbar is-fixed-top does not appear to work in dark mode

This is either an issue or I'm unaware of how to do it properly. There is a simple way to reproduce what I'm seeing.

According to the Bulma documentation, we can do the following to DeepThought's out-of-the-box example:

Edit the html tag to:
<html lang="{{lang}}" class="has-navbar-fixed-top">

and edit the navbar tag to:
<nav aria-label="section navigation" class="navbar is-light is-fixed-top" role="navigation">

When I do this, it works as expected in light mode, but not at all in dark mode. Not only that, but it adds a white bar above the navbar.
image

Screenshot of it not staying fixed in dark mode:
image

Screenshot of it staying fixed in light mode:
image

Can't use DeepThought as a theme - doesn't render anything in content/

First, I've looked and installed Zola themes and DeepThought looks great. Thank you for sharing it.

I've installed DeepThought into ~/zola/themes, then changed config.toml
theme = "DeepThought"

I added the extra configuration options needed.

The problem is, when I do "zola serve" I get a blank site.

The first image is the home page. ( http://127.0.0.1:1111/ )
Screen Shot 2020-10-07 at 13 48 41

The second image is the /posts link. ( http://127.0.0.1:1111/posts )
Screen Shot 2020-10-07 at 13 46 57

If I go into themes/DeepThought and then do "zola serve" I get your sample site.

As I understand it, I should leave your theme alone so I can check out updates from GitHub. I should not put my content in your directory. I've tried both ~/zola/content

zola serve                   
Building site...
-> Creating 6 pages (0 orphan), 0 sections, and processing 0 images
Done in 37ms.

and ~/zola/content/posts

zola serve                  
Building site...
-> Creating 6 pages (6 orphan), 0 sections, and processing 0 images
Done in 30ms.

So ~/zola/content seems better.

Am I doing something wrong?

Missing RSS / Atom feed icon

The RSS / Atom feed icon is not showing up in the social links, but it's still present there and it's possible to click on it.

Screenshot from 2021-08-21 20-32-03

Can't really show what's wrong, but the right-most space is where the link is, but the icon isn't.

Feature request: Top n posts and docs on index

I tried to display the top 3 docs or top 3 posts on the main page via _index.md or index.html template and current index.html don't have sections for pages from docs or blogs.
What's the right way to expose blog and docs articles via index?

Error Checking out Latest Codebase

just checked out the latest codebase, but it fails when trying to serve.

joesan@joesan-InfinityBook-S-14-v5:~/Projects/Private/github-docs/DeepThought$ zola serve
Building site...
Error: invalid type: sequence, expected a map for key languages at line 67 column 1

That line should be changed to

[languages.en]

Issued a PR!

Dark mode flickers on load of new page

After activating the dark mode and clicking on any link inside the website the light theme quickly flickers before the page is set to the dark theme again.

An example would be when clicking on the on the posts page from the home page.

Affected browsers:
Firefox 94.0 (64-bit) on Ubuntu 20.04.3 LTS
Chrome Version 95.0.4638.69 (Official Build) (64-bit) on Ubuntu 20.04.3 LTS
iOS 14.8.1

According to StackOverflow this solution is to have a blocking change of theme before the page loads: https://stackoverflow.com/a/63033934

But it seams the theme is changed after the page is ready, hence the flicker:

$(document).ready(function () {
mermaid.initialize({ startOnLoad: true });
if (localStorage.getItem("theme") === "dark") {
$("body").attr("theme", "dark");
$("img, picture, video").attr("theme", "dark");

Multilingual navbar

Thank you for your great work on DeepThought, I really like your theme and want to use it.
I would like to create a multilingual navbar based on what already exists do you have any idea how I can do that?

Footer block is gone

Hey @RatanShreshtha, thank you for your great work here. I really appreciate it and it's a while that I am using it in my blog! However, today I pulled the last changes of this theme, where I noticed the footer block is not where it was before! It removed in this commit.

Fix 404 page 
@@ -173,7 +165,6 @@
  {% block comment %}
  {% endblock %}

-  {% block footbar %}
  <footer class="footer py-4">
    <div class="content has-text-centered">
      <p>
@@ -203,7 +194,6 @@

Is it intended or a mistake?

Organize md files in sub folders

This is a wonderful template that I'm considering using for my blog. I did give it a try, but I need some help on an issue that I'm facing. Here it is:

In the docs folder I have created several sub folders in which I have added the respective .md files. I want to get the same effect as when I click on the posts in the website navigation, I have to get the .md files listed based on created date. When I tried this, I do not get to see the files listed and all I see is an empty page. Do I need to make any modifications to the _index.md such that the page lists all the .md files from inside the sub folders?

Tweet Plugin for Posts

Is it possible to have a tweet plugin / button against each post so that I can generate a tweet link and post it to twitter when clicked? This tweet button should be shown against each post.

Feature Request: Custom CSS to fix footnotes

Footnotes within Zola will render like the following:
image

This seems to be a flaw in the markdown engine that Zola uses and It's been addressed here, a workaround in CSS to fix the formatting at least would be nice.

Avatar variable is required for 404 template, but not for index template

Hi, thanks for your work on this great looking zola theme!

When I was setting up my blog without an avatar, I noticed that in the index.html template it is not required.
https://github.com/RatanShreshtha/DeepThought/blob/master/templates/index.html#L7-L11

But for the 404.html template it is required, and this breaks the static site build.
https://github.com/RatanShreshtha/DeepThought/blob/master/templates/404.html#L8-L10

Should we surround the 404 avatar image with a

{% if config.extra.author.avatar %}
...
{% endif %}

block?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.