Add page via API - lektor

I run a little lektor blog and want to add a number of pages that I created using a python script. However, after copying the created content folders with their resp. content.lr files into my blog folder, those new pages do not show. Is there an API way of adding pages? Or do I have to use the admin UI to add a page? Didn't found anything in the docs so far.

Related

Use multiple themes on one website jeykll

I have recently found out about jekyll, and want to make a project landing page with it. I would like to have a home page using one theme (e.g. ubuild) and have another page for the docs (accessed via a navigation bar at the top) that uses a different theme (e.g. just-the-docs). How can I go about doing this?
EDIT: I want to use Github Pages for this.
Since you plan to use one of the themes on just a single page, I think the best solution would be to use two base layouts instead of two themes.
It will take some minor work initially, but will greatly ease future maintenance.
First set up the site to render just-the-docs theme for all pages including the landing page. Then modify _layouts/home.html to be a parent layout (like the default layout)
to render the markup from the ubuild.. theme.
I solved this with help from #JoostS's answer but with a few modifications:
Make an organization on GitHub pages with a repo called <org-name>.github.io. This repo should contain the theme for the home page (ubuild in my case) and all the content for it.
Make another repo with a jeykll site, called docs. This site should have the theme you want for the other page (just-the-docs in my case) and all the content along with it.
In the docs repo, add baseurl: "/docs" to your _config.yml
The <org-name>.github.io repo, should now be hosted at <org-name>.github.io/:
The docs repo should now be hosted at the <org-name>.github.io/docs url:
To link to the docs page, you should just be able to use /docs now.
The solution is to create two separate websites. The first site contains just the homepage and should be deployed to the root of your web folder. The second site contains all docs and should be deployed to a subdirectory, like '/docs/'. You might want to use baseurl for this: https://byparker.com/blog/2014/clearing-up-confusion-around-baseurl/
I do not think you can use this solution on Github pages. You can TRY to add the same CNAME to both repositories, as I am not 100% sure. Any other static hosting environment should work.
You can link from the docs to the homepage by linking to '/'. You can link from the homepage to the docs by linking to '/docs/pagename/' (assuming you use permalink: pretty).
The simplest way to maintain two layouts on the same site using Jekyll with GitHub Pages is for you to create a new repository for the new layout, so the main site is in a GitHub organization and the pages that need to use a different layout must be in your repositories.
However, if you are not using GitHub, just jekyll, just configure each folder as a new Jekyll project, and direct them to write to the respective subfolders in the _site folder. For everything to work out you need to start Jekyll Server from the main folder, and then build each subfolder separately, so it will update without removing the main one

Locating the main website (front page) file in cpanel for website built on laravel and voyager

I am trying to locate the file or folder in cpanel that the front page of my website is housed in so i can add a floating action button script to my website.
I just have no prior experience here.
(I am trying to add this in correct place)
It should have a finished result as here http://www.floatingactionbutton.com
The views or 'pages' of the application should be in the resources/views/ directory. You may find a view that is 'home' or something similar but there is no way of knowing what the views have been named when your application was developed.
The views may not be in straight HTML / PHP but rather use Laravel's Blade syntax.
In addition, existing javascript files in your site may have been compiled using Webpack. I imagine the floating action button will be a javascript script.
Can you get the original developer to add the script for you?

sitecore Add users and Media folder after create sub site

I have a sitecore 7.0 solution with several sites.
Every time that I add a new site I need to create specific users (author, approver, etc..) and a specific Media Folder to the website.
Question:
Is there any way to make this automatically? I was thinking to play a bit with the pipelines but I'm not sure exactly how to start..
Thank you
I have made a custom command for this which:
asks for a site name (using Context.ClientPage.Start and Context.ClientPage.ClientResponse.Input)
creates a sites structure based on a template-branch
creates media library folders
I did not need users but you can add that as well. The only thing left to do manually is adding the configuration files.
There are many blog posts to find about adding custom commands, like:
http://www.sitecore.net/Learn/Blogs/Technical-Blogs/John-West-Sitecore-Blog/Posts/2013/04/Add-Debug-Command-to-Content-Editor-in-the-Sitecore-ASPNET-CMS.aspx
And also branches:
http://www.sitecore.net/Learn/Blogs/Technical-Blogs/Getting-to-Know-Sitecore/Posts/2012/10/Page-Editor-Secrets-1-Complex-Content-Creation.aspx

Django multi-image upload in admin panel with ajax - some example

I find many articles with multi-image and plugins:
https://github.com/blueimp/jQuery-File-Upload
https://pypi.python.org/pypi/django-multiuploader etc.
But I don't know how use it in django admin when I have ImageField. I want to do gallery.
Now I have inline adding image in albums. Please help me and give some full example :) (I'm newbie)
We use django-jfu to upload many files outside the admin.
Interfacing to the admin is certainly possible by creating a custom admin method to invoke jfu. Add a completion button to the jfu upload page that creates the desired db records when the user is done uploading files. These would then be available within the admin.

How can I read in project readme.md's into a user.github.com site?

Github now has automatic page generation for projects. Thats brill - it reads in the readme.markdown file in the project root and creates a neat site using a template.
The thing missing though is user.github.com pages. Is there anyway to (either automatically or by passing a config file) read in all of my current GitHub projects readme documents and push into a site design for a user.github.com template system??
Thanks!
The 'user.github.com' sites are built via GitHub Pages. They are independent repositories, the name of which matches the domain where they will appear. For example, my github username is 'alanwsmith'. I've got a repo called 'alanwsmith.github.com' which is processed via jekyll and available at: http://alanwsmith.github.com/.
Since they are independent and valid repositories, the GitHub doesn't apply any automation to them. The processing via jekyll only outputs the site. It doesn't mess with the contents of the repo itself. If you want to automatically list all your project Readme files on your user.github.com domain, you'll have to build your own process to gather the files and drop them in the source repo.
Of course, your individual user page (e.g. https://github.com/alanwsmith instead of http://alanwsmith.github.com/) lists your repos. Those links point to the individual project pages which, as you mention, display the readme files. I think that's as close as GitHub gets to doing what you want at this point in time.
More details on GitHub Pages can be found in the GitHub Pages Help section.

Resources