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 <<a=
href=3D"javascript:" target=3D"_blank" gdf-obfuscated-mailto=3D"h4B_F6OEGM=
4J">eje...@gmail.com</a>> wrote:
<br>> Hi everyone, newbie here.
<br>
<br>Welcome!
<br>
<br>>
<br>> I just want to know how is it possible to use the YAML in the <=
body>,
<br>> especially in the <head> of the web page. I can't seem to fi=
nd any examples
<br>> on the docs and the web.
<br>>
<br>> For example, if I put the following:
<br>> ---
<br>> robots: noindex, nofollow
<br>> ---
<br>>
<br>> How can I access that 'robots' to be usable in the web page itself=
. My goal
<br>> is to put it to the <meta />, like the following:
<br>> <meta robots=3D"robots" content=3D"${}" />
<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><meta robots=3D"robots" content=3D"${post.robots}" />
<br>
<br>in the _templates/site.mako file.
<br></blockquote></blockquote><div><br>Hi Doug,<br><br>When I tried y=
our solution and rebuild blogofile (to apply the changes), it returns an e=
rror.<br>I do: <br>>> 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> 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> rendered =3D self.mako_template.re=
nder(**self)<br> File "/usr/local/lib/python2.7/dist-packages/mako/te=
mplate.py", line 412, in render<br> return runtime._rende=
r(self, self.callable_, args, data)<br> File "/usr/local/lib/python2.=
7/dist-packages/mako/runtime.py", line 766, in _render<br>  =
; **_kwargs_for_callable(callable_, data))<br> File "/usr/local/lib/p=
ython2.7/dist-packages/mako/runtime.py", line 798, in _render_context<br>&n=
bsp; _exec_template(inherit, lclcontext, args=3Dargs, kwargs=3D=
kwargs)<br> File "/usr/local/lib/python2.7/dist-packages/mako/runtime=
.py", line 824, in _exec_template<br> callable_(context, =
*args, **kwargs)<br> File "_templates/base.mako", line 2, in render_b=
ody<br> ${next.body()}<br> File "_templates/site.ma=
ko", line 12, in render_body<br> <meta name=3D"robots"=
content=3D"${post.robots}" /><br> 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> 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> File "/usr/local/bin/blogofile", line 9, in &l=
t;module><br> load_entry_point('Blogofile=3D=3D0.8-DEV=
', 'console_scripts', 'blogofile')()<br> File "/usr/local/lib/python2=
.7/dist-packages/Blogofile-0.8_DEV-py2.7.egg/blogofile/main.py", line 58, i=
n main<br> args.func(args)<br> 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> writer.write_site()<br> 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> self.__run_co=
ntrollers()<br> 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=
> controller.run_all(namespaces)<br> 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> c.mod.run()<br> =
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; permapage.run()<br> 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> write_permap=
ages()<br> 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> "permapage.mako", bf.util.=
path_join(path, "index.html"), env)<br> File "/usr/local/lib/python2.=
7/dist-packages/Blogofile-0.8_DEV-py2.7.egg/blogofile/plugin.py", line 135,=
in materialize_template<br> lookup=3Dlookup, caller=3Dse=
lf.module)<br> 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> template.render(location)<br> 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> rendered =3D self.mako_tem=
plate.render(**self)<br> File "/usr/local/lib/python2.7/dist-packages=
/mako/template.py", line 412, in render<br> return runtim=
e._render(self, self.callable_, args, data)<br> File "/usr/local/lib/=
python2.7/dist-packages/mako/runtime.py", line 766, in _render<br> &nb=
sp; **_kwargs_for_callable(callable_, data))<br> File "/usr/loc=
al/lib/python2.7/dist-packages/mako/runtime.py", line 798, in _render_conte=
xt<br> _exec_template(inherit, lclcontext, args=3Dargs, k=
wargs=3Dkwargs)<br> File "/usr/local/lib/python2.7/dist-packages/mako=
/runtime.py", line 824, in _exec_template<br> callable_(c=
ontext, *args, **kwargs)<br> File "base_mako", line 23, in render_bod=
y<br> File "site_mako", line 36, in render_body<br> 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; raise AttributeError(name)<br>AttributeError: robots<br></block=
quote> <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--