mbox series

[qemu-web,0/7] Tweaks to page footer and add "edit page" links

Message ID 20201023152957.488974-1-berrange@redhat.com
Headers show
Series Tweaks to page footer and add "edit page" links | expand

Message

Daniel P. Berrangé Oct. 23, 2020, 3:29 p.m. UTC
This series started off as a desire to add an "Edit page" link to every
page on the site. In doing this I felt that the footer would benefit
from simplication so that it was not a massive wall of links,
duplicating links elsewhere in the navigation or content pages.

I also add gitlab CI jobs so that users can push a branch to gitlab and
then browse the rendered result.

eg see this pipeline:

  https://gitlab.com/berrange/qemu-web/-/pipelines/206891542

and the rendered result:

  https://berrange.gitlab.io/qemu-web/

Or browsable at

  https://gitlab.com/berrange/qemu-web/-/jobs/809000762/artifacts/browse/publ=
ic/

Or download ZIP at

  https://gitlab.com/berrange/qemu-web/-/jobs/809000762/artifacts/download

notice how the resulting content needs to cope with being used from a
variety of different paths. IOW, we cannot use absolute hyperlinks that
assume the root is "/".  Jekyll doesn't make this easy, so we use a hack
with a custom template that sets a variable we can then reference.

The logical next step for this would be to accept merge requests, so
that once the user saves their edits in gitlab, they can directly submit
a MR, instead of sending via email.  I noticed we don't currently have a
CONTRIBUTING.md file in qemu-web.git telling people how to submit. So
this series includes such a file directing people to send patches via
email for now.

Daniel P. Berrang=C3=A9 (7):
  Convert files to UNIX line endings
  gitlab: introduce a CI job to publish the site content
  make all links be relative to the root
  Make page header nav narrower
  Simplify and restructure the page footer
  Add link to "edit this page" for all pages
  Add a CONTRIBUTING.md file as guidance for contributors

 .gitlab-ci.yml               |   16 +
 CONTRIBUTING.md              |   32 +
 _config.yml                  |    1 +
 _includes/assets.html        |   28 +-
 _includes/copyright.html     |    8 -
 _includes/footer.html        |   33 +-
 _includes/nav.html           |   13 +-
 _includes/relative_root.html |   12 +
 _includes/sidebar.html       |    6 +-
 _layouts/archive.html        |    4 +-
 _layouts/blog.html           |    4 +-
 _layouts/home.html           |    2 +-
 _layouts/page.html           |    2 +-
 assets/css/style-desktop.css |  575 ++++++++--------
 assets/css/style-mobile.css  |  739 +++++++++++----------
 assets/css/style.css         | 1200 +++++++++++++++++-----------------
 blog/index.html              |    4 +-
 index.html                   |  178 ++---
 18 files changed, 1448 insertions(+), 1409 deletions(-)
 create mode 100644 .gitlab-ci.yml
 create mode 100644 CONTRIBUTING.md
 delete mode 100644 _includes/copyright.html
 create mode 100644 _includes/relative_root.html

--=20
2.26.2

Comments

Paolo Bonzini Oct. 23, 2020, 3:47 p.m. UTC | #1
On 23/10/20 17:29, Daniel P. Berrangé wrote:
> The link takes the user directly to the source markdown file in gitlab,
> where they can press the "Edit" button and make changes directly in the
> browser. They will be prompted to fork the project when committing the
> changes if they don't already have a fork.  The result is a commit which
> can be submitted for review per the contributing guidelines.
> 
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>

I think this is a good idea *if* we switch to merge requests for website
edits---which isn't something I'm opposed to.

Paolo

> ---
>  _includes/footer.html        | 3 +++
>  assets/css/style-desktop.css | 4 ++++
>  assets/css/style.css         | 2 +-
>  3 files changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/_includes/footer.html b/_includes/footer.html
> index 2dd247b..0a77d8e 100644
> --- a/_includes/footer.html
> +++ b/_includes/footer.html
> @@ -1,4 +1,7 @@
>  <div id="footer">
> +	<div id="edit-page">
> +		<a href="https://gitlab.com/qemu-project/qemu-web/-/blob/master/{{page.path}}">edit this page</a>
> +	</div>
>  	<div id="external-links">
>  		<ul class="style">
>  			<li><a href="http://qemu-advent-calendar.org">Advent calendar</a></li>
> diff --git a/assets/css/style-desktop.css b/assets/css/style-desktop.css
> index d45ec15..19272ad 100644
> --- a/assets/css/style-desktop.css
> +++ b/assets/css/style-desktop.css
> @@ -102,6 +102,10 @@
>  /* Footer                                                                        */
>  /*********************************************************************************/
>  
> +	#edit-page {
> +		text-align: right;
> +	}
> +
>  	#licenses {
>  		float: right;
>  	}
> diff --git a/assets/css/style.css b/assets/css/style.css
> index e2fee29..50bbcd1 100644
> --- a/assets/css/style.css
> +++ b/assets/css/style.css
> @@ -514,7 +514,7 @@
>  		margin: 0em;
>  	}
>  
> -	#conservancy, #licenses {
> +	#conservancy, #licenses, #edit-page {
>  		padding: 0em;
>  		padding-left: 1em;
>  		padding-right: 1em;
>
Daniel P. Berrangé Oct. 23, 2020, 4:19 p.m. UTC | #2
On Fri, Oct 23, 2020 at 05:47:45PM +0200, Paolo Bonzini wrote:
> On 23/10/20 17:29, Daniel P. Berrangé wrote:
> > The link takes the user directly to the source markdown file in gitlab,
> > where they can press the "Edit" button and make changes directly in the
> > browser. They will be prompted to fork the project when committing the
> > changes if they don't already have a fork.  The result is a commit which
> > can be submitted for review per the contributing guidelines.
> > 
> > Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> 
> I think this is a good idea *if* we switch to merge requests for website
> edits---which isn't something I'm opposed to.

Note if you disable merge requests, then the page we link to doesn't
show a live editor. It merely shows the read-only source. Not as
useful, at least the user can see which source file they need to
touch in their fork, which is still a step forwards I think.

> 
> Paolo
> 
> > ---
> >  _includes/footer.html        | 3 +++
> >  assets/css/style-desktop.css | 4 ++++
> >  assets/css/style.css         | 2 +-
> >  3 files changed, 8 insertions(+), 1 deletion(-)
> > 
> > diff --git a/_includes/footer.html b/_includes/footer.html
> > index 2dd247b..0a77d8e 100644
> > --- a/_includes/footer.html
> > +++ b/_includes/footer.html
> > @@ -1,4 +1,7 @@
> >  <div id="footer">
> > +	<div id="edit-page">
> > +		<a href="https://gitlab.com/qemu-project/qemu-web/-/blob/master/{{page.path}}">edit this page</a>
> > +	</div>
> >  	<div id="external-links">
> >  		<ul class="style">
> >  			<li><a href="http://qemu-advent-calendar.org">Advent calendar</a></li>
> > diff --git a/assets/css/style-desktop.css b/assets/css/style-desktop.css
> > index d45ec15..19272ad 100644
> > --- a/assets/css/style-desktop.css
> > +++ b/assets/css/style-desktop.css
> > @@ -102,6 +102,10 @@
> >  /* Footer                                                                        */
> >  /*********************************************************************************/
> >  
> > +	#edit-page {
> > +		text-align: right;
> > +	}
> > +
> >  	#licenses {
> >  		float: right;
> >  	}
> > diff --git a/assets/css/style.css b/assets/css/style.css
> > index e2fee29..50bbcd1 100644
> > --- a/assets/css/style.css
> > +++ b/assets/css/style.css
> > @@ -514,7 +514,7 @@
> >  		margin: 0em;
> >  	}
> >  
> > -	#conservancy, #licenses {
> > +	#conservancy, #licenses, #edit-page {
> >  		padding: 0em;
> >  		padding-left: 1em;
> >  		padding-right: 1em;
> > 
> 
> 

Regards,
Daniel
Paolo Bonzini Oct. 23, 2020, 5:07 p.m. UTC | #3
On 23/10/20 18:19, Daniel P. Berrangé wrote:
>> I think this is a good idea *if* we switch to merge requests for website
>> edits---which isn't something I'm opposed to.
> Note if you disable merge requests, then the page we link to doesn't
> show a live editor. It merely shows the read-only source. Not as
> useful, at least the user can see which source file they need to
> touch in their fork, which is still a step forwards I think.
> 

I agree, so I think if you change it to "View source" it's okay.

Paolo