Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion SEO-related issues

Date: Sat, 8 Sep 2012 04:59:04 -0700 (PDT)
From: EJelome <ejel...@gmail.com>
To: blogofile-discuss@googlegroups.com
Cc: d...@douglatornell.ca
Message-Id: <f9db2a87-8c75-49bf-9809-78bd010dfc4a@googlegroups.com>
In-Reply-To: <CAGGjgCG8tXi8MvrBravvC=HmAdFb91hE0brfqsj8Kh84f9S8LA@mail.gmail.com>
References: <dfe7fe63-bd74-4820-9f02-c625ce6bb2c6@googlegroups.com>
 <CAGGjgCG8tXi8MvrBravvC=HmAdFb91hE0brfqsj8Kh84f9S8LA@mail.gmail.com>
Subject: Re: SEO-related issues
MIME-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_1290_3879628.1347105544071"

------=_Part_1290_3879628.1347105544071
Content-Type: multipart/alternative; 
	boundary="----=_Part_1291_8658793.1347105544071"

------=_Part_1291_8658793.1347105544071
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit




On Friday, September 7, 2012 9:33:49 PM UTC+8, Doug Latornell wrote:
>
> On Fri, Sep 7, 2012 at 2:09 AM, EJelome <eje...@gmail.com <javascript:>> 
> wrote: 
> > Hi everyone, newbie here. 
>
> Welcome! 
>
> > 
> > I just want to know how is it possible to use the YAML in the <body>, 
> > especially in the <head> of the web page. I can't seem to find any 
> examples 
> > on the docs and the web. 
> > 
> > For example, if I put the following: 
> > --- 
> > robots: noindex, nofollow 
> > --- 
> > 
> > How can I access that 'robots' to be usable in the web page itself. My 
> goal 
> > is to put it to the <meta />, like the following: 
> > <meta robots="robots" content="${}" /> 
>
> The YAML header data is available for use in templates in the post 
> namespace. So, with the default templates, you should be able to get 
> what you want with: 
>
> <meta robots="robots" content="${post.robots}" /> 
>
> in the _templates/site.mako file. 
>

Hi Doug,

When I  tried your solution and rebuild blogofile (to apply the changes), 
it returns an error.
I do: 
>> blogofile build -s blogname

Then it returns the following:

ERROR:blogofile.template:Error rendering template: permapage.mako
>
> Traceback (most recent call last):
>   File 
> "/usr/local/lib/python2.7/dist-packages/Blogofile-0.8_DEV-py2.7.egg/blogofile/template.py", 
> line 157, in render
>     rendered = self.mako_template.render(**self)
>   File "/usr/local/lib/python2.7/dist-packages/mako/template.py", line 
> 412, in render
>     return runtime._render(self, self.callable_, args, data)
>   File "/usr/local/lib/python2.7/dist-packages/mako/runtime.py", line 766, 
> in _render
>     **_kwargs_for_callable(callable_, data))
>   File "/usr/local/lib/python2.7/dist-packages/mako/runtime.py", line 798, 
> in _render_context
>     _exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
>   File "/usr/local/lib/python2.7/dist-packages/mako/runtime.py", line 824, 
> in _exec_template
>     callable_(context, *args, **kwargs)
>   File "_templates/base.mako", line 2, in render_body
>     ${next.body()}
>   File "_templates/site.mako", line 12, in render_body
>     <meta name="robots" content="${post.robots}" />
>   File 
> "/usr/local/lib/python2.7/dist-packages/blogofile_blog-0.8-py2.7.egg/blogofile_blog/site_src/_controllers/blog/post.py", 
> line 291, in __getattr__
>     raise AttributeError(name)
> AttributeError: robots
>
> ERROR:blogofile:Fatal build error occured, calling 
> bf.config.build_exception()
> Traceback (most recent call last):
>   File "/usr/local/bin/blogofile", line 9, in <module>
>     load_entry_point('Blogofile==0.8-DEV', 'console_scripts', 
> 'blogofile')()
>   File 
> "/usr/local/lib/python2.7/dist-packages/Blogofile-0.8_DEV-py2.7.egg/blogofile/main.py", 
> line 58, in main
>     args.func(args)
>   File 
> "/usr/local/lib/python2.7/dist-packages/Blogofile-0.8_DEV-py2.7.egg/blogofile/main.py", 
> line 388, in do_build
>     writer.write_site()
>   File 
> "/usr/local/lib/python2.7/dist-packages/Blogofile-0.8_DEV-py2.7.egg/blogofile/writer.py", 
> line 49, in write_site
>     self.__run_controllers()
>   File 
> "/usr/local/lib/python2.7/dist-packages/Blogofile-0.8_DEV-py2.7.egg/blogofile/writer.py", 
> line 162, in __run_controllers
>     controller.run_all(namespaces)
>   File 
> "/usr/local/lib/python2.7/dist-packages/Blogofile-0.8_DEV-py2.7.egg/blogofile/controller.py", 
> line 229, in run_all
>     c.mod.run()
>   File 
> "/usr/local/lib/python2.7/dist-packages/blogofile_blog-0.8-py2.7.egg/blogofile_blog/site_src/_controllers/blog/__init__.py", 
> line 80, in run
>     permapage.run()
>   File 
> "/usr/local/lib/python2.7/dist-packages/blogofile_blog-0.8-py2.7.egg/blogofile_blog/site_src/_controllers/blog/permapage.py", 
> line 12, in run
>     write_permapages()
>   File 
> "/usr/local/lib/python2.7/dist-packages/blogofile_blog-0.8-py2.7.egg/blogofile_blog/site_src/_controllers/blog/permapage.py", 
> line 38, in write_permapages
>     "permapage.mako", bf.util.path_join(path, "index.html"), env)
>   File 
> "/usr/local/lib/python2.7/dist-packages/Blogofile-0.8_DEV-py2.7.egg/blogofile/plugin.py", 
> line 135, in materialize_template
>     lookup=lookup, caller=self.module)
>   File 
> "/usr/local/lib/python2.7/dist-packages/Blogofile-0.8_DEV-py2.7.egg/blogofile/template.py", 
> line 388, in materialize_template
>     template.render(location)
>   File 
> "/usr/local/lib/python2.7/dist-packages/Blogofile-0.8_DEV-py2.7.egg/blogofile/template.py", 
> line 157, in render
>     rendered = self.mako_template.render(**self)
>   File "/usr/local/lib/python2.7/dist-packages/mako/template.py", line 
> 412, in render
>     return runtime._render(self, self.callable_, args, data)
>   File "/usr/local/lib/python2.7/dist-packages/mako/runtime.py", line 766, 
> in _render
>     **_kwargs_for_callable(callable_, data))
>   File "/usr/local/lib/python2.7/dist-packages/mako/runtime.py", line 798, 
> in _render_context
>     _exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
>   File "/usr/local/lib/python2.7/dist-packages/mako/runtime.py", line 824, 
> in _exec_template
>     callable_(context, *args, **kwargs)
>   File "base_mako", line 23, in render_body
>   File "site_mako", line 36, in render_body
>   File 
> "/usr/local/lib/python2.7/dist-packages/blogofile_blog-0.8-py2.7.egg/blogofile_blog/site_src/_controllers/blog/post.py", 
> line 291, in __getattr__
>     raise AttributeError(name)
> AttributeError: robots
>
 
I think I have to declare the keyword 'robots' somewhere (correct me if I'm 
wrong) so the compiler will know that it exist, only that I don't know 
where should I put it.

------=_Part_1291_8658793.1347105544071
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable

<br style=3D"margin: 0px 0px 0px 0.8ex; border-left: 1px solid rgb(204, 204=
, 204); padding-left: 1ex;" class=3D"gmail_quote"><blockquote><br>On Friday=
, September 7, 2012 9:33:49 PM UTC+8, Doug Latornell wrote:<blockquote clas=
s=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #c=
cc solid;padding-left: 1ex;">On Fri, Sep 7, 2012 at 2:09 AM, EJelome &lt;<a=
 href=3D"javascript:" target=3D"_blank" gdf-obfuscated-mailto=3D"h4B_F6OEGM=
4J">eje...@gmail.com</a>&gt; wrote:
<br>&gt; Hi everyone, newbie here.
<br>
<br>Welcome!
<br>
<br>&gt;
<br>&gt; I just want to know how is it possible to use the YAML in the &lt;=
body&gt;,
<br>&gt; especially in the &lt;head&gt; of the web page. I can't seem to fi=
nd any examples
<br>&gt; on the docs and the web.
<br>&gt;
<br>&gt; For example, if I put the following:
<br>&gt; ---
<br>&gt; robots: noindex, nofollow
<br>&gt; ---
<br>&gt;
<br>&gt; How can I access that 'robots' to be usable in the web page itself=
. My goal
<br>&gt; is to put it to the &lt;meta /&gt;, like the following:
<br>&gt; &lt;meta robots=3D"robots" content=3D"${}" /&gt;
<br>
<br>The YAML header data is available for use in templates in the post
<br>namespace. So, with the default templates, you should be able to get
<br>what you want with:
<br>
<br>&lt;meta robots=3D"robots" content=3D"${post.robots}" /&gt;
<br>
<br>in the _templates/site.mako file.
<br></blockquote></blockquote><div><br>Hi Doug,<br><br>When I&nbsp; tried y=
our solution and rebuild blogofile (to apply the changes),  it returns an e=
rror.<br>I do: <br>&gt;&gt; blogofile build -s blogname<br><br>Then it retu=
rns the following:<br><br><blockquote style=3D"margin: 0px 0px 0px 0.8ex; b=
order-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;" class=3D"gmai=
l_quote">ERROR:blogofile.template:Error rendering template: permapage.mako<=
br><br>Traceback (most recent call last):<br>&nbsp; File "/usr/local/lib/py=
thon2.7/dist-packages/Blogofile-0.8_DEV-py2.7.egg/blogofile/template.py", l=
ine 157, in render<br>&nbsp;&nbsp;&nbsp; rendered =3D self.mako_template.re=
nder(**self)<br>&nbsp; File "/usr/local/lib/python2.7/dist-packages/mako/te=
mplate.py", line 412, in render<br>&nbsp;&nbsp;&nbsp; return runtime._rende=
r(self, self.callable_, args, data)<br>&nbsp; File "/usr/local/lib/python2.=
7/dist-packages/mako/runtime.py", line 766, in _render<br>&nbsp;&nbsp;&nbsp=
; **_kwargs_for_callable(callable_, data))<br>&nbsp; File "/usr/local/lib/p=
ython2.7/dist-packages/mako/runtime.py", line 798, in _render_context<br>&n=
bsp;&nbsp;&nbsp; _exec_template(inherit, lclcontext, args=3Dargs, kwargs=3D=
kwargs)<br>&nbsp; File "/usr/local/lib/python2.7/dist-packages/mako/runtime=
.py", line 824, in _exec_template<br>&nbsp;&nbsp;&nbsp; callable_(context, =
*args, **kwargs)<br>&nbsp; File "_templates/base.mako", line 2, in render_b=
ody<br>&nbsp;&nbsp;&nbsp; ${next.body()}<br>&nbsp; File "_templates/site.ma=
ko", line 12, in render_body<br>&nbsp;&nbsp;&nbsp; &lt;meta name=3D"robots"=
 content=3D"${post.robots}" /&gt;<br>&nbsp; File "/usr/local/lib/python2.7/=
dist-packages/blogofile_blog-0.8-py2.7.egg/blogofile_blog/site_src/_control=
lers/blog/post.py", line 291, in __getattr__<br>&nbsp;&nbsp;&nbsp; raise At=
tributeError(name)<br>AttributeError: robots<br><br>ERROR:blogofile:Fatal b=
uild error occured, calling bf.config.build_exception()<br>Traceback (most =
recent call last):<br>&nbsp; File "/usr/local/bin/blogofile", line 9, in &l=
t;module&gt;<br>&nbsp;&nbsp;&nbsp; load_entry_point('Blogofile=3D=3D0.8-DEV=
', 'console_scripts', 'blogofile')()<br>&nbsp; File "/usr/local/lib/python2=
.7/dist-packages/Blogofile-0.8_DEV-py2.7.egg/blogofile/main.py", line 58, i=
n main<br>&nbsp;&nbsp;&nbsp; args.func(args)<br>&nbsp; File "/usr/local/lib=
/python2.7/dist-packages/Blogofile-0.8_DEV-py2.7.egg/blogofile/main.py", li=
ne 388, in do_build<br>&nbsp;&nbsp;&nbsp; writer.write_site()<br>&nbsp; Fil=
e "/usr/local/lib/python2.7/dist-packages/Blogofile-0.8_DEV-py2.7.egg/blogo=
file/writer.py", line 49, in write_site<br>&nbsp;&nbsp;&nbsp; self.__run_co=
ntrollers()<br>&nbsp; File "/usr/local/lib/python2.7/dist-packages/Blogofil=
e-0.8_DEV-py2.7.egg/blogofile/writer.py", line 162, in __run_controllers<br=
>&nbsp;&nbsp;&nbsp; controller.run_all(namespaces)<br>&nbsp; File "/usr/loc=
al/lib/python2.7/dist-packages/Blogofile-0.8_DEV-py2.7.egg/blogofile/contro=
ller.py", line 229, in run_all<br>&nbsp;&nbsp;&nbsp; c.mod.run()<br>&nbsp; =
File "/usr/local/lib/python2.7/dist-packages/blogofile_blog-0.8-py2.7.egg/b=
logofile_blog/site_src/_controllers/blog/__init__.py", line 80, in run<br>&=
nbsp;&nbsp;&nbsp; permapage.run()<br>&nbsp; File "/usr/local/lib/python2.7/=
dist-packages/blogofile_blog-0.8-py2.7.egg/blogofile_blog/site_src/_control=
lers/blog/permapage.py", line 12, in run<br>&nbsp;&nbsp;&nbsp; write_permap=
ages()<br>&nbsp; File "/usr/local/lib/python2.7/dist-packages/blogofile_blo=
g-0.8-py2.7.egg/blogofile_blog/site_src/_controllers/blog/permapage.py", li=
ne 38, in write_permapages<br>&nbsp;&nbsp;&nbsp; "permapage.mako", bf.util.=
path_join(path, "index.html"), env)<br>&nbsp; File "/usr/local/lib/python2.=
7/dist-packages/Blogofile-0.8_DEV-py2.7.egg/blogofile/plugin.py", line 135,=
 in materialize_template<br>&nbsp;&nbsp;&nbsp; lookup=3Dlookup, caller=3Dse=
lf.module)<br>&nbsp; File "/usr/local/lib/python2.7/dist-packages/Blogofile=
-0.8_DEV-py2.7.egg/blogofile/template.py", line 388, in materialize_templat=
e<br>&nbsp;&nbsp;&nbsp; template.render(location)<br>&nbsp; File "/usr/loca=
l/lib/python2.7/dist-packages/Blogofile-0.8_DEV-py2.7.egg/blogofile/templat=
e.py", line 157, in render<br>&nbsp;&nbsp;&nbsp; rendered =3D self.mako_tem=
plate.render(**self)<br>&nbsp; File "/usr/local/lib/python2.7/dist-packages=
/mako/template.py", line 412, in render<br>&nbsp;&nbsp;&nbsp; return runtim=
e._render(self, self.callable_, args, data)<br>&nbsp; File "/usr/local/lib/=
python2.7/dist-packages/mako/runtime.py", line 766, in _render<br>&nbsp;&nb=
sp;&nbsp; **_kwargs_for_callable(callable_, data))<br>&nbsp; File "/usr/loc=
al/lib/python2.7/dist-packages/mako/runtime.py", line 798, in _render_conte=
xt<br>&nbsp;&nbsp;&nbsp; _exec_template(inherit, lclcontext, args=3Dargs, k=
wargs=3Dkwargs)<br>&nbsp; File "/usr/local/lib/python2.7/dist-packages/mako=
/runtime.py", line 824, in _exec_template<br>&nbsp;&nbsp;&nbsp; callable_(c=
ontext, *args, **kwargs)<br>&nbsp; File "base_mako", line 23, in render_bod=
y<br>&nbsp; File "site_mako", line 36, in render_body<br>&nbsp; File "/usr/=
local/lib/python2.7/dist-packages/blogofile_blog-0.8-py2.7.egg/blogofile_bl=
og/site_src/_controllers/blog/post.py", line 291, in __getattr__<br>&nbsp;&=
nbsp;&nbsp; raise AttributeError(name)<br>AttributeError: robots<br></block=
quote>&nbsp;<br>I think I have to declare the keyword 'robots' somewhere (c=
orrect me if I'm wrong) so the compiler will know that it exist, only that =
I don't know where should I put it.<br></div>
------=_Part_1291_8658793.1347105544071--

------=_Part_1290_3879628.1347105544071--