apache / lucene

Apache Lucene open-source search software
https://lucene.apache.org/
Apache License 2.0
2.71k stars 1.04k forks source link

Fix issue with newsticker and other included stuff on Lucene webpage [LUCENE-5789] #6851

Open asfimport opened 10 years ago

asfimport commented 10 years ago

When talking to asfinfra today, they told me, that there is a solutions for the problem we have on the Lucene web page:

The index markdown file includes other files like the newsticker markdown. If you update the newsticker, the main webpage is not updated, unless you do a fake commit on the index markdown.

The solution is here (Apache Thrift uses this, including example):

[18:46] joes4: ThetaPh1: the way to deal with included files is through the %path::dependencies hash
[18:46] ThetaPh1: ah there is a solution for that?
[18:46] joes4: yes see the thrift cms site
[18:46] ThetaPh1: the last time we asked there was only the fake commit on the file that includes
[18:46] ThetaPh1: in short: how must the link look like?
[18:47] joes4: $dependencies{"path_to_base_file"} = [ `@list_of_files_to_be_included` ]
[18:47] joes4: in path.pm
[18:49] ThetaPh1: ok, I'll open a lucene issue to fix this on our website
[18:49] ThetaPh1: it mainly affects news ticker, which is a separte markdown
[18:49] joes4: https://svn.apache.org/repos/asf/thrift/cms-site/trunk/lib/path.pm
[18:49] joes4: they are doing ther state of the art
[18:50] joes4: dynamicly generated %dependencies hash

Migrated from LUCENE-5789 by Uwe Schindler (@uschindler), updated Jun 30 2014

asfimport commented 10 years ago

Joe Schaefer (migrated from JIRA)

All paths for the %dependencies hash are rooted in the content/ directory.

asfimport commented 10 years ago

Joe Schaefer (migrated from JIRA)

Looking at the mechanism behind this... it seems you have certain templates that include files within the content/ dir. Would you like me to upgrade your view.pm file so you can use templating constructs from within markdown files? You have a lot of cruft in there that was copied from www.apache.org long ago.

asfimport commented 10 years ago

Uwe Schindler (@uschindler) (migrated from JIRA)

Hi Joe, I would be happy if you help me. I had no time to look into this up to now, so any help is appreciated.

asfimport commented 10 years ago

Joe Schaefer (migrated from JIRA)

Ok you should be good now. The logic is a little tortured in the way these files are being included, which can be made clearer by passing "preprocess => 1" in your view arguments for those files, which will allow you to include content using template expressions directly in your markdown sources.

asfimport commented 10 years ago

Uwe Schindler (@uschindler) (migrated from JIRA)

Thanks Joe, if you just give me a short snippet how to include for example the mainnews.mdtext markdown into the index.mdtext homepage without using the templates. In my opinion, the workaround with the templates to do all includes was horrible to use.

I am verifying the current staging website and check if its identical to the current published one - sor far, looks good. I will go forward and publish the changes done by you later. The code looks much simplier now, because it just includes the official Apache "View" perl script.

asfimport commented 10 years ago

Joe Schaefer (migrated from JIRA)

Ok I'm done converting things. Try to keep a clean separation between stuff in content/ and stuff in templates/- things will work better that way.