Comments (13)
I think the admin interface will not work locally. I have never tried it in this way.
But what you are trying is a very good use-case indeed.
I'll have a look to make everything smoother for running it locally, because it totally makes sense - whether for use with org-mode or simply for having a tool for local note-keeping, that can eventually be synced with other non-local instances.
from servus.
Would you mind posting the command you are using to run Servus and the filesystem structure (the output of find sites
) so I can try to replicate the issue?
To me it seems you are missing an "index", because that is what would be rendered if you access "/". Basically you would need a file named _content/pages/index.md
.
This is what I have...
$ cat sites/ibz.me/_content/pages/index.md
---
title: ''
---
Welcome to {{ site.title }}!
from servus.
BTW, you will also need to populate _layouts
. That is done automatically if you create a site using the admin interface or the REST API, but if you do it manually, you'll need to add some layouts there.
Here is what needs to be present in a site directory, at a very minimum: https://github.com/servuscms/servus/tree/master/themes/default - besides the _config.toml
!
from servus.
tihs is my command
~/bin/servus $ ./target/debug/servus
Found site: schizo
Loading layouts...
Loaded 4 templates!
Scanning file ./sites/schizo/_content/pages/posts.md...
Resource: url=/posts.
Scanning file ./sites/schizo/_content/pages/index.md...
Resource: url=/index.
Site loaded!
1 sites loaded!
tide::server Server listening on http://0.0.0.0:4884
and this is the output when I try to browse http://0.0.0.0:4884
tide::log::middleware <-- Request received
method GET
path /
tide::log::middleware Client error --> Response sent
method GET
path /
status 404 - Not Found
from servus.
TL/DR: This will solve your problem: mv sites/schizo sites/0.0.0.0:4884
.
The reason is that the way to determine what site to serve (you can have multiple) is using the hostname - or, in this case, of running it locally, it is simply the ip:port
- so you need to name your site the same as what you will be using to access it.
I agree that for this simple case of running it locally (and/or of having only one site) it is counter-intuitive. I'll come up with some better way for this case, But for now, the above solution should work.
from servus.
now it seems to work, but I've this error
tide::log::middleware <-- Request received
method GET
path /
thread 'async-std/runtime' panicked at src/site.rs:417:37:
called `Result::unwrap()` on an `Err` value: Error { kind: Msg("Failed to render 'page.html' (error happened in 'base.html')."), source: Some(Error { kind: Msg("Variable `site.tagline` not found in context while rendering 'page.html'"), source: None }) }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
I guess it's a configuration problem, so I tried to create a site using the admin interface, but I didn't understand how to do it.
If, for example, I run
./target/debug/servus --admin-domain 0.0.0.0
and I browse http://0.0.0.0:4884/api/sites
I got
tide::log::middleware <-- Request received
method GET
path /api/sites
tide::log::middleware Client error --> Response sent
method GET
path /api/sites
status 400 - Bad Request
from servus.
Edit your _config.toml
and set tagline = "something"
under the [site]
section. That will pass site.tagline
to the layout.
from servus.
It works!
I thought there might be other configuration problems and therefore having to use the administration interface, but now it's already fine. Now I need to figure out how to use org-capture to populate the site's directories with the correct md files...
Thank you
from servus.
I think you will encounter one more issue if you do that: you add .md
files, but Servus doesn't know about them because it only checks for new files on start. The only way (currently) to add posts when it is running is to post via the Nostr protocol. But I am thinking to make it such that it somehow finds the new files while already running.
from servus.
Even if I restart servous it scans the new md files but does not publish them (both in pages and in posts)... in any case I await the new changes you will be able to make... Thanks for your work
from servus.
If you are able to restart it from org-mode, then it should work. On start, it scans all files and they are automatically published! If that doesn't work, let me know...
from servus.
I do not know how to do; If I do I'll let you know
from servus.
Now I need to figure out how to use org-capture to populate the site's directories with the correct md files...
DONE exporting org file through pandoc.el (I export titles, dates, etc.)
Now I need to obtain an ssl cert; I've tried your suggestions, with "ssl-acme" option and using "acme.sh", without success
from servus.
Related Issues (10)
- Add atom support
- Limit access to special files/directories
- Add SEO tags
- Error { kind: Msg("Variable `page.date` not found in context while rendering 'post.html HOT 21
- My experenice in trying servus preview, posting and SSL errors HOT 4
- Cannot intialise after build HOT 1
- Set port and disable HTTPS (HTTP only mode) HOT 3
- Can servus work seamlessly with zola? HOT 3
- Blossom implementation fixes 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 servus.