Hyperlinks showing URL with Blueprint
It's likely you have something like this in your CSS:
a:link:after { content:" (" attr(href) ") "; }
That will produce the behavior you describe.
Typically, you would only use this kind of style for the print version of your stylesheet.
Blueprint CSS - Link showing both URL and text
Don't load print.css
without specifying media="print"
Linking to Blueprint CSS tabs?
It does too work.
http://pastebin.com/bQun2DNV
has to be tested as an html file.
key code snippet:
$("ul.tabs a[href="+location.hash+"]").click();
Hyperlinks are showing path in Magento
You have this in your skin/frontend/default/default/css/home/css/blueprint/print.css :
a:link:after, a:visited:after {content:" (" attr(href) ")";font-size:90%;}
remove it and it will work as expected
Why the href attributes of a tags are printed to screen?
It looks like you may be grabbing the print.css for the screen. Make sure you have your media types set properly.
In Firefox, when printing a page with anchor tags, the link location is printing after the text
The answer was in the css framework we are using (Blueprint). There was the below line in the style file:
a:link:after,a:visited:after{content:"(" attr(href) ")";font-size:90%}
Guess this might help others who use Blueprint.
Creating link to an url of Flask app in jinja2 template
I feel like you're asking two questions here but I'll take a shot...
For the posting url you'd do this:
<a href="{{ url_for('post_blueprint.get_post', year=year, month=month, title=title)}}">
{{ title }}
</a>
To handle static files I'd highly suggest using an asset manager like Flask-Assets, but to do it with vanilla flask you do:
{{ url_for('static', filename='[filenameofstaticfile]') }}
If you'd like more information I highly suggest you read. http://flask.pocoo.org/docs/quickstart/#static-files and http://flask.pocoo.org/docs/quickstart/#url-building
Edit for using kwargs:
Just thought I'd be more thorough...
If you'd like to use url_for
like this:
{{ url_for('post_blueprint.get_post', **post) }}
You have to change your view to something like this:
@post_blueprint.route('/posts/')
def get_all_posts():
models = database_call_of_some_kind # This is assuming you use some kind of model
posts = []
for model in models:
posts.append(dict(year=model.year, month=model.month, title=model.title))
return render_template('p.html', posts=posts)
Then your template code can look like this:
{% for post in posts %}
<a href="{{ url_for('post_blueprint.get_post', **post) }}">
{{ post['title'] }}
</a>
{% endfor %}
At this point I would actually create a method on the model so you don't have to turn it into a dict, but going that far is up to you :-).
Related Topics
Input[Type=Number] Placeholder Color in Ff29+
Rounding Numbers in SASS and Adjusting the Amount of Decimals
How to Create a Row of Elements of Equal Width Inside an Inline Container? Possibly Using Flexbox
Are CSS Variable Changes Possible Upon a Radio Button's Checked Selector Being Triggered
Is There a CSS Selector for the First Child, Taking Text Nodes into Account
Getting Unordered List in Front of Image Slide-Show in IE8, IE7 and Probably IE6
Font-Style: Italic VS Oblique in CSS
Why Do Professional-Made Websites Have Odd #Id and .Class Names
Header Div Stays at Top, Vertical Scrolling Div Below with Scrollbar Only Attached to That Div
How to Force a Vertical Scrollbar to Appear
CSS Selectors - How to Select 'For' in CSS
Inherited Text-Decoration Style
How to Revert Back to Normal After Display:None for Table Row
CSS Filter Cancels Element Position
Bootstrap 4.1 - to Get Grid System Only
What Happens When the Browser Doesn't Support a CSS Pseudo-Class
CSS Keyframe Animation CPU Usage Is High, Should It Be This Way